"use strict";

import { Label } from "konva/lib/shapes/Label";

// import { generateUUID } from './data-parsers'
// 原始画面
export const CAMERA_PIPELINE_ID_ORIGINALLY = "Originally";
// 目标检测 topic
export const CAMERA_STREAM_ID = "inference/uyolo/result";
// 异常检测 topic
export const ANOMALY_DETECTION_TYPE = "inference/rd4ad/result";
// 姿态检测 topic
export const SKELETON_RECONSTRUCTION_TYPE = "inference/mm-c3d/result";
// 手部关节 topic
export const HAND_SKELETON_RECONSTRUCTION_TYPE = "inference/uhand/result";

export const CAMERA_STREAM_NULL = "--"; // `camera-null-stream-${generateUUID()}`

export const WARN_MSG_TYPE_UN_SAFETY_HAT = 2; // 未佩戴安全帽警告
export const WARN_MSG_TYPE_PICTURE = 1; // 人员入侵警告
export const WARN_MSG_TYPE_INTRUDE = 3; // 异常占用警告

export const KONVA_BORDER_COLOR_RED = "204, 68, 68";

export const KONVA_BORDER_COLOR_GREEN = "136, 204, 136";

export const REASON_CODE_HAT = 1; // 未佩戴安全帽警告
export const REASON_CODE_PHONE = 2; // 手机偷拍

export const targetHighlightOptions = [
  {
    label: "原始画面",
    labelWithI18n: "targetHighlightOptions.originalVideo",
    value: CAMERA_PIPELINE_ID_ORIGINALLY,
  },
  {
    label: "目标检测",
    labelWithI18n: "targetHighlightOptions.targetDetection",
    value: CAMERA_STREAM_ID,
  },
  {
    label: "异常检测",
    labelWithI18n: "targetHighlightOptions.anomalyDetection",
    value: ANOMALY_DETECTION_TYPE,
  },
  {
    label: "姿态估计",
    labelWithI18n: "targetHighlightOptions.skeletonReconstruction",
    value: SKELETON_RECONSTRUCTION_TYPE,
  },
  {
    label: "手部关节",
    labelWithI18n: "targetHighlightOptions.handSkeletonReconstruction",
    value: HAND_SKELETON_RECONSTRUCTION_TYPE,
  },
];

// 关节的连接关系 for 姿态
export const CONNECTIONS_FOR_POSE: [number, number][] = [
	[1, 2 /* 左眼 */],
	[1, 3 /* 右眼 */],
	[2, 3 /* 眉心 */],
	[2, 4 /* 左脸 */],
	[3, 5 /* 右脸 */],
	[6, 7 /* 躯干 */],
	[4, 6 /* 左肩 */],
	[5, 7 /* 右肩 */],
	[6, 12 /* 躯干 */],
	[6, 8 /* 左肘 */],
	[7, 9 /* 右肘 */],
	[7, 13 /* 躯干 */],
	[8, 10 /* 左手腕 */],
	[9, 11 /* 右手腕 */],
	[12, 13 /* 躯干 */],
	[14, 12 /* 左髋 */],
	[15, 13 /* 右髋 */],
	[16, 14 /* 左脚踝 */],
	[17, 15 /* 右脚踝 */],
];

// 关节的连接关系 for 手
export const CONNECTIONS_FOR_HAND: [number, number][] = [
	[1, 2],
	[2, 3],
	[3, 4],
	[4, 5],
	[1, 6],
	[6, 7],
	[7, 8],
	[8, 9],
	[6, 10],
	[10, 11],
	[11, 12],
	[12, 13],
	[10, 14],
	[14, 15],
	[15, 16],
	[16, 17],
	[14, 18],
	[1, 18],
	[18, 19],
	[19, 20],
	[20, 21],
];
